#!/bin/bash

show_menu() {
  echo "请选择要执行的命令："
  echo "1. 备份"
  echo "2. 恢复"
  echo "3. 退出"
  read -p "请输入选项（1/2/3）：" choice
}
script_dir=$(dirname "$0")
command1="bash $script_dir/备份.sh"
command2="bash $script_dir/恢复.sh"

# 主循环
while true; do
  show_menu

  case "$choice" in
    1)
      echo "准备备份"
      $command1
      echo
      ;;
    2)
      echo "准备恢复"
      $command2
      echo
      ;;
    3)
      echo "退出脚本。"
      exit 0
      ;;
    *)
      echo "无效的选项，请重新输入！"
      echo
      ;;
  esac
done